get request url in asp.net core

45

get request url in asp.net core -

//get request url in asp.net core
using Microsoft.AspNetCore.Http.Extensions; 


var url = httpContext.Request.GetEncodedUrl();
//or
var url = httpContext.Request.GetDisplayUrl();
//or
var url = HttpContext.Current.Request.Url.AbsoluteUri;

Comments

Submit
0 Comments